var request = {
	QueryString : function(val) {
		//var uri = window.location.search;
		//var re = new RegExp("" +val+ "\=([^\&\?]*)", "ig");
		//return ((uri.match(re))?(uri.match(re)[0].substr(val.length+1)):null);
		var svalue = location.search.match(new RegExp("[\?\&]" + val+ "=([^\&]*)(\&?)","i"));
		return svalue ? svalue[1] : svalue;
	},
	QueryStrings : function() {
		var uri = window.location.search;
		var re = /\w*\=([^\&\?]*)/ig;
		var retval=[];
		while ((arr = re.exec(uri)) != null)
		retval.push(arr[0]);
		return retval;
	},
	setQuery : function(val1, val2) {
		var a = this.QueryStrings();
		var retval = "";
		var seted = false;
		var re = new RegExp("^" +val1+ "\=([^\&\?]*)$", "ig");
		for(var i=0; i<a.length; i++) {
			if (re.test(a[i])) {
				seted = true;
				a[i] = val1 +"="+ val2;
			}
		}
		retval = a.join("&");
		return "?" +retval+ (seted ? "" : (retval ? "&" : "") +val1+ "=" +val2);
	}
}

//拼接url，return 带有参数的url
var splicingUrl = function(url, obj){
	url = url.split('?')[0] + '?';
	for(var i in obj){
		url += i + '=' + obj[i] + '&';
	}
	return url.substr(0, url.length - 1);
}

//重写alert方法，去掉地址显示
window.alert = function(name){
	var iframe = document.createElement("IFRAME");
	iframe.style.display="none";
	iframe.setAttribute("src", 'data:text/plain,');
	document.documentElement.appendChild(iframe);
	window.frames[0].window.alert(name);
	iframe.parentNode.removeChild(iframe);
}

//重写confirm方法，去掉地址显示
window.confirm = function(name){
	var iframe = document.createElement("IFRAME");
	iframe.style.display="none";
	iframe.setAttribute("src", 'data:text/plain,');
	document.documentElement.appendChild(iframe);
	var result = window.frames[0].window.confirm(name);
	iframe.parentNode.removeChild(iframe);
	return result;
}